﻿// ControlDlg.cpp: 实现文件
//

#include "pch.h"
#include "ProjectAA.h"
#include "ControlDlg.h"
#include "afxdialogex.h"


// CControlDlg 对话框

IMPLEMENT_DYNAMIC(CControlDlg, CDialogEx)

CControlDlg::CControlDlg(CWnd* pParent /*=nullptr*/)
	: CDialogEx(IDD_DIALOG_CONTROL, pParent)
{

}

CControlDlg::~CControlDlg()
{
}

void CControlDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CControlDlg, CDialogEx)
	ON_BN_CLICKED(IDC_BUTTON1, &CControlDlg::OnBnClickedButton1)
	ON_BN_CLICKED(IDC_BUTTON2, &CControlDlg::OnBnClickedButton2)
	ON_BN_CLICKED(IDC_BUTTON3, &CControlDlg::OnBnClickedButton3)
	ON_BN_CLICKED(IDC_BUTTON4, &CControlDlg::OnBnClickedButton4)
END_MESSAGE_MAP()


// CControlDlg 消息处理程序


BOOL CControlDlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	return TRUE;
}


void CControlDlg::OnCancel()
{
	CDialogEx::OnCancel();
}



void CControlDlg::OnBnClickedButton1()
{
	if (gSystemMgr.Y06 == OFF) {
		gSystemMgr.m_cIo.SetOutputIo(6, ON);
	}
	else {
		gSystemMgr.m_cIo.SetOutputIo(6, OFF);
	}
}


void CControlDlg::OnBnClickedButton2()
{
	gSystemMgr.m_cIo.SetOutputIo(9, ON);
	Sleep(50);
	gSystemMgr.m_cIo.SetOutputIo(9, OFF);
}


void CControlDlg::OnBnClickedButton3()
{
	gSystemMgr.m_cIo.SetOutputIo(10, ON);
	Sleep(50);
	gSystemMgr.m_cIo.SetOutputIo(10, OFF);
}


void CControlDlg::OnBnClickedButton4()
{
	gSystemMgr.m_cIo.SetOutputIo(11, ON);
	Sleep(50);
	gSystemMgr.m_cIo.SetOutputIo(11, OFF);
}
